package aboutus.action;

import aboutus.dao.AboutUsDao;
import aboutus.model.AboutUs;

import com.opensymphony.xwork2.ActionSupport;

public class AboutUsAction extends ActionSupport{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private AboutUsDao aboutUsDao;
	
	private AboutUs aboutUs;

	public AboutUs getAboutUs() {
		return aboutUs;
	}

	public void setAboutUs(AboutUs aboutUs) {
		this.aboutUs = aboutUs;
	}

	public AboutUsDao getAboutUsDao() {
		return aboutUsDao;
	}

	public void setAboutUsDao(AboutUsDao aboutUsDao) {
		this.aboutUsDao = aboutUsDao;
	}
	
	public String toAboutUs(){
		aboutUs = aboutUsDao.findById(1L);
		return SUCCESS;
	}
	public String toAboutUsAdmin(){
		aboutUs = aboutUsDao.findById(1L);
		return SUCCESS;
	}
	
	public String saveAboutUs(){
		System.out.println(aboutUs.getId());
		aboutUsDao.saveOrUpdate(aboutUs);
		return SUCCESS;
	}
}
